package cn.iocoder.yudao.module.pmp.api;

import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.module.pmp.api.dto.ProjectDTO;
import cn.iocoder.yudao.module.pmp.dal.dataobject.project.ProjectDO;
import cn.iocoder.yudao.module.pmp.service.project.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
public class PmpApiImpl implements PmpApi {


    @Autowired
    private ProjectService projectService;

    @Override
    public ProjectDTO getProject(Long id) {
        ProjectDO project = projectService.getProject(id);
        return  BeanUtil.toBean(project, ProjectDTO.class);
    }
}
